import * as THREE from "three";

const geometry = new THREE.BoxGeometry(60, 30, 20)
const material = new THREE.MeshLambertMaterial({
    color: 0xffffff,
    transparent: true,
    opacity: 0.8
})
const boxMesh = new THREE.Mesh(geometry, material)
// .rotation角度属性和角度属性值欧拉Euler
// 欧拉角描述一个旋转变换，通过指定轴顺序和其各个抽向上的指定旋转角度来旋一个物体，
// 对 Euler 实例进行遍历将按相应的顺字生成它的分量(x，y, z, order).

const euler = new THREE.Euler(0, 10, 0)
boxMesh.rotation.y = Math.PI / 4 //绕Y轴转一个角度---可用于旋转动画
boxMesh.rotateY(Math.PI / 2) //45°

// 实例化一个颜色对象
const color = new THREE.Color()//属性为r，g，b
color.r = 0
color.g = 0
color.setRGB(0, 1, 0)
color.setStyle('#fff000')
color.setHex(0xffff00)
console.log(color, "颜色对象");
// material.color= color
material.color.set(0x000ff)
material.color.set('#00ff00')
export default boxMesh